<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/taglib_include.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, target-densitydpi=medium-dpi, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5, user-scalable=no" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<link href="${ctx}/css/main.css?ver=${main_css_version}" rel="stylesheet" type="text/css" />
<style type="text/css">
  #login ul li input {
      font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;
      font-size:18pt;
  }
</style>
<title>${projectTitle }</title>
</head>
<body>
  <header id="main-top">
    <!-- 该返回按钮暂时不使用，隐藏掉 -->
    <a href="#" style="visibility:hidden;">
      <div id="main-top-left">
        <img src="${ctx}/images/mui_title_back_btn.png" class="img-2">
      </div>
    </a>
    <div id="main-top-title">用户登录</div>
  </header>
  <div id="container">
    <form id="loginForm" action="${ctx}/login/verify.do" method="post" autocomplete="on">
      <div id="login">
        <ul>
          <li>
            <label>用户名</label>
            <input id="uname" name="username" type="text" required="required">
          </li>
          <li class="pass">
            <label>密&nbsp;&nbsp;&nbsp;码</label>
            <input id="pwd" name="password" type="password" required="required">
            <c:if test="${not empty returnUrl}">
              <input id='url' name="returnUrl" type="hidden" value="${returnUrl}">
            </c:if>
          </li>
        </ul>
      </div>
    </form>
    <a id="loginButton" href="javascript:;">
      <div id="determine">登录</div>
    </a>
    <div id="N-registered">
      <span class="R-password">
        <a href="${ctx}/resetpwd/index.do">找回密码</a>
      </span>
      <a id="gotoRegister" href="javascript:;">
             新用户
        <span>
          <img src="${ctx}/images/blue-next.png" class="img-4">
        </span>
      </a>
    </div>
  </div>
  <form id="gotoRegisterForm" action="${ctx}/register/autoadd.do" method="post">
      <c:if test="${not empty returnUrl}">
        <input type="hidden" name="returnUrl" value="${returnUrl}"/>
      </c:if>
  </form>
  <%@ include file="/WEB-INF/views/popup_alert.jsp"%>
  <script type="text/javascript" src="${ctx}/js/jquery.min.js?ver=${jquery_min_version}"></script>
  <!-- mergeTo:${ctx}/js/custom.min.js?ver=${custom_min_version} -->
  <script type="text/javascript" src="${ctx}/js/custom.js?ver=${custom_version}"></script>
  <!-- mergeTo -->
  <script type="text/javascript">
    $(document).ready(function() {
    	if (sessionStorage.userName) {
    		$("#uname").val(sessionStorage.userName);
    	}

        $("#determine").bind("click", function(e) {
        	var userName = $("#uname").val();
        	var password = $("#pwd").val();
        	sessionStorage.userName = userName;

        	if (userName == "") {
        		openAlert("请输入用户名");
        		return false;
        	} else if (password == "") {
        		openAlert("请输入密码");
        		return false;
        	} else {
        	}
            $("#loginForm").submit();
        });

        $("#gotoRegister").bind("click", function(e) {
        	$("#gotoRegisterForm").submit();
        });
    });
  </script>
</body>
</html>